// Exchange Quote, 交易所数据
#pragma once

#include <map>
#include <mutex>
#include <string>

#include "BondInfo.h"

class S_BONDLIB_EXPORT CXCQuote {
 public:
  std::map<std::string, XCQUOTE> m_map;  // marketid,xcquote
};

class S_BONDLIB_EXPORT CXCQuoteRep {
 public:
  CXCQuoteRep();
  virtual ~CXCQuoteRep();
  bool Clear();

  int GetSize() const;
  int GetBytes(int mode = 0) const;
  int GetItemSize() const { return sizeof(XCQUOTE); }
  const char* GetName() const;

  bool InsertQuote(const XCQUOTE& newElement);
  bool GetQuoteByKey(const std::string& sKey, XCQUOTE& stRep);

 protected:
  CXCQuote m_RepMap;
  std::mutex m_lock;
};
